package it.uniroma2.structure;

import java.io.Serializable;

public class Literal implements BPEL_Element, Serializable{
	private String expression;
	private final String space = "preserve";
	private boolean instance;
	
	public Literal(String expr, boolean instantiation){
		this.expression = expr;
		this.instance = instantiation;
	}
	
	
	
	public String getExpression() {
		return expression;
	}



	public void setExpression(String expression) {
		this.expression = expression;
	}



	@Override
	public String toBPEL() {
		String output = "";
		if(!this.instance){
			output = output + "<" + literalTag + " " + xmlSpaceTag + "\"" + this.space + "\">\n";
			output = output + this.expression;
			output = output + "</" + literalTag + ">\n";
		}else{
			output = output + "<" + literalTag + ">\n";
			output = output + this.expression;
			output = output + "</" + literalTag + ">\n";
		}
		
		return output;
	}

}
